package monster.comm.action;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

import monster.comm.util.SessionBean;
import monster.comm.util.SysConstant;

/**
 * <p>所有action基类</p>
 * <p>主要方法返回登录人员的sessionbean</p>
 * @author wanghong
 * 2012-12-24
 * monster.comm.action.BaseAction
 * 
 */
public class BaseAction extends ActionSupport {
	private static final long serialVersionUID = -9104229525474561761L;
	//后台admin的action出现异常的跳转页面
	public static final java.lang.String ADMIN_EXCEPTION = "admin_exception";
	//教师空间的action出现异常跳转页面
	public static final java.lang.String TEAWORK_EXCEPTION = "teawork_exception";
	//学生家长空间的action出现异常跳转页面
	public static final java.lang.String PSWORK_EXCEPTION = "pswork_exception";

	/**
	 * 返回sessionbean
	 * @return sessionbean
	 */
	public SessionBean getUserSession(){
		HttpSession session = ServletActionContext.getRequest().getSession(false);
		return  (SessionBean)(session!=null?session.getAttribute(SysConstant.SESSION_NAME):null);
	}
}
